package com.thinvent.nj.ais.conf;

import org.springframework.cache.Cache;
import org.springframework.cache.ehcache.EhCacheCacheManager;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MyCommonConfig {

    /**
     * shiroSessionCache
     * @param ehCacheCacheManager
     * @return
     */
    @Bean(name = "shiroSessionCache")
    public Cache shiroSessionCache(EhCacheCacheManager ehCacheCacheManager) {
        ehCacheCacheManager.getCacheManager().addCache("shiro-sessionCache");

        return ehCacheCacheManager.getCache("shiro-sessionCache");
    }
}